<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!doctype html>
<html lang="zh-cmn">
<head>
    <%@include file="/WEB-INF/pages/header.jsp"%>
    <link rel="stylesheet" href="${ctx}/res/css/liu_individual.css">
    <meta http-equiv="Content-Type" content="multipart/form-data; charset=utf-8" />
</head>
<body>
<div class="container">
    <div class="panel-body" id="userupdate">
        <form class="form-horizontal" id="addUserInfo_form" method="post" enctype="multipart/form-data">
            <div class="form-group">
                <label class="col-md-5 control-label"></label>
                <div class="col-md-7 ">
                    <input type="file" id="imgupload" style="display: none" name="tijiao" onchange="fooderimg()" accept="image/gif,image/jpeg,image/jpg,image/png,image/svg">
                    <label for="imgupload">
                        <img src="/statics/images/img.jpg" class="img-circle profile_img" id="headportrait">
                    </label>
                </div>
            </div>
            <div class="form-group">
                <label class="col-md-4 control-label">登录名：</label>
                <div class="col-md-8">
                    <label class="control-label" id="loginName">${sessionScope.loginUser.loginName}</label>
                </div>
            </div>
            <div class="form-group">
                <label class="col-md-4 control-label">出生日期：</label>
                <div class="col-md-5">
                    <input type="date" class="form-control" name="birthday">
                </div>
                <label class="control-label liu_updatets" id="pwdred"></label>
            </div>
            <div class="form-group">
                <label class="col-md-4 control-label">姓名：</label>
                <div class="col-md-5">
                    <input type="text" class="form-control"  name="name">
                </div>
                <label class="control-label liu_updatets"></label>
            </div>
            <div class="form-group">
                <label class="col-md-4 control-label">性别：</label>
                <div class="col-md-5" id="sexdiv">
                    <label class="radio-inline">
                        <input type="radio" name="sex" value="1" id="sex">男
                    </label>
                    <label class="radio-inline">
                        <input type="radio" name="sex" value="0" id="girl">女
                    </label>
                </div>
                <label class="control-label liu_updatets"></label>
            </div>
            <div class="form-group">
                <label class="col-md-4 control-label">联系电话：</label>
                <div class="col-md-5">
                    <input type="text" class="form-control" name="phone">
                </div>
            </div>
            <div class="form-group">
                <label class="col-md-4 control-label">地址：</label>
                <div class="col-md-5">
                    <input type="text" class="form-control" name="address">
                </div>
            </div>
            <div class="form-group">
                <label class="col-md-4 control-label">角色：</label>
                <div class="col-md-5">
                    <label id="liujuese"class="control-label"></label>
                </div>
                <label class="control-label liu_updatets"></label>
            </div>
            <div class="form-group">
                <label class="col-md-8">
                </label>
                <div class="col-md-1">
                    <input type="button" name="update" value="修改" class="btn btn-primary" onclick="liuupdate();">
                </div>
            </div>
        </form>
     <div>
</div>
<%@include file="/WEB-INF/pages/footer.jsp"%>
<script src="${ctx}/res/js/liuindivdual.js"></script>
        <script>
            var dlname = $("#loginName").html();
            $.ajax({
                data:"loginName="+dlname,
                dataType:'json',
                url:ctx+"/sys/user/getIndiv",
                async:false,
                success:function(user){
                    $("[name=name]").val(user.userName);
                    $("[name=address]").val(user.address);
                    $("[name=phone]").val(user.mobileNo);
                    $("[name=birthday]").val(user.birthday);
                    var element = document.getElementById('headportrait');
                    var headimg = user.userPhoto;
                    element.src = "/statics/images/headportrait/"+headimg;
                    var a = user.gender;
                    if(a == 0){
                        document.getElementById("girl").checked = true;
                    }else{
                        document.getElementById("sex").checked = true;
                    }
                    var roleId = user.roleId
                    $.post(ctx+"/sys/user/getRole","roleId="+roleId,function (a){
                        $("#liujuese").html(a);
                    })
                }
            });
        </script>
</body>
</html>